import { axios } from '@/utils/request'

const api = {

  gradeOptions: '/adminapi/material/gradeOptions',

  //新建实验器材
  resourceAdd:'/adminapi/resource/resourceAdd',
  resourceDelete:'/adminapi/resource/resourceDelete',
  resourceEdit:'/adminapi/resource/resourceEdit',
  resourceDetail:'/adminapi/resource/resourceDetail',
  resourceList:'/adminapi/resource/resourceList',

  learningSection: '/adminapi/resource/learningSection',
  subjectOptions: '/adminapi/resource/subjectOptions',
  gradeTreeOptions: '/adminapi/resource/gradeTreeOptions',


  //收藏模块
  collectionAdd:'/adminapi/mycollection/collectionAdd',
  collectionDelete:'/adminapi/mycollection/collectionDelete',
  getCollectionList:'/adminapi/mycollection/collectionList',

}

export default api

export function getCollectionList(parameter) {
  return axios({
    url: api.collectionList,
    method: 'get',
    params: parameter
  })
}
export function collectionDelete(parameter) {
  return axios({
    url: api.collectionDelete,
    method: 'post',
    data: parameter
  })
}
export function collectionAdd(parameter) {
  return axios({
    url: api.collectionAdd,
    method: 'post',
    data: parameter
  })
}
//新建实验器材
export function resourceAdd(parameter) {
  return axios({
    url: api.resourceAdd,
    method: 'post',
    data: parameter
  })
}

export function resourceDelete(parameter) {
  return axios({
    url: api.resourceDelete,
    method: 'post',
    data: parameter
  })
}

export function resourceEdit(parameter) {
  return axios({
    url: api.resourceEdit,
    method: 'get',
    params: parameter
  })
}

export function resourceDetail(parameter) {
  return axios({
    url: api.resourceDetail,
    method: 'post',
    data: parameter
  })
}

export function getResourceList(parameter) {
  return axios({
    url: api.resourceList,
    method: 'get',
    params: parameter
  })
}

export function gradeOptions(parameter) {
  return axios({
    url: api.gradeOptions,
    method: 'get',
    params: parameter
  })
}

export function materialOptions(parameter) {
  return axios({
    url: api.materialOptions,
    method: 'get',
    params: parameter
  })
}

export function subjectOptions(parameter) {
  return axios({
    url: api.subjectOptions,
    method: 'get',
    params: parameter
  })
}

export function learningSection(parameter) {
  return axios({
    url: api.learningSection,
    method: 'get',
    params: parameter
  })
}

export function gradeTreeOptions(parameter) {
  return axios({
    url: api.gradeTreeOptions,
    method: 'get',
    params: parameter
  })
}